home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1997 September / Macworld (1997-09).dmg / Serious Software / Cherwell Scientific Demos / pro Fit / pro Fit 5.0 demo (ppc).sea / pro Fit 5.0 demo (ppc) / Functions & Programs / Histogram < prev    next >
MacBinary  |  1996-04-15  |  4.5 KB  |  [ftFC/NLft]

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: Histogram

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Mon Apr 15 18:28:02 1996, modified Mon Apr 15 18:28:02 1996, creator 'NLft', type 'ftFC', 3640 bytes "Histogram" , at 0xeb8 679 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ftFC]
macFileCreator[NLft]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 48 69 73 74 6f 67 | 72 61 6d 00 00 00 00 00 |..Histog|ram.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 66 74 46 43 4e 4c 66 | 74 01 00 00 00 00 00 00 |.ftFCNLf|t.......|
|00000050| 00 00 00 00 00 0e 38 00 | 00 02 a7 ad 98 7d f2 ad |......8.|.....}..|
|00000060| 98 7d f2 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.}......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 4f 9b 00 00 |........|....O...|
|00000080| 7b 20 54 68 69 73 20 70 | 72 6f 67 72 61 6d 20 67 |{ This p|rogram g|
|00000090| 65 6e 65 72 61 74 65 73 | 20 61 20 68 69 73 74 6f |enerates| a histo|
|000000a0| 67 72 61 6d 20 6f 66 20 | 61 20 6f 6e 65 2d 64 69 |gram of |a one-di|
|000000b0| 6d 65 6e 73 69 6f 6e 61 | 6c 20 64 61 74 61 20 73 |mensiona|l data s|
|000000c0| 65 74 2e 20 7d 0d 7b 20 | 54 68 65 20 64 61 74 61 |et. }.{ |The data|
|000000d0| 20 73 65 74 20 28 77 68 | 69 63 68 20 6d 75 73 74 | set (wh|ich must|
|000000e0| 20 62 65 20 73 74 6f 72 | 65 64 20 69 6e 20 61 20 | be stor|ed in a |
|000000f0| 63 6f 6c 75 6d 6e 20 6f | 66 20 61 20 64 61 74 61 |column o|f a data|
|00000100| 20 77 69 6e 64 6f 77 29 | 20 69 73 20 7d 0d 7b 20 | window)| is }.{ |
|00000110| 66 69 72 73 74 20 61 6e | 61 6c 79 7a 65 64 20 62 |first an|alyzed b|
|00000120| 79 20 63 6f 75 6e 74 69 | 6e 67 20 74 68 65 20 6e |y counti|ng the n|
|00000130| 75 6d 62 65 72 20 6f 66 | 20 64 61 74 61 20 70 6f |umber of| data po|
|00000140| 69 6e 74 73 20 69 6e 20 | 65 61 63 68 20 69 6e 74 |ints in |each int|
|00000150| 65 72 76 61 6c 2e 20 7d | 0d 7b 20 54 68 65 6e 2c |erval. }|.{ Then,|
|00000160| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 64 | the num|ber of d|
|00000170| 61 74 61 20 70 6f 69 6e | 74 73 20 69 73 20 70 6c |ata poin|ts is pl|
|00000180| 6f 74 74 65 64 20 61 73 | 20 61 20 66 75 6e 63 74 |otted as| a funct|
|00000190| 69 6f 6e 20 6f 66 20 74 | 68 65 20 69 6e 74 65 72 |ion of t|he inter|
|000001a0| 76 61 6c 2e 20 7d 0d 7b | 20 54 6f 20 75 73 65 20 |val. }.{| To use |
|000001b0| 74 68 65 20 70 72 6f 67 | 72 61 6d 2c 20 63 68 6f |the prog|ram, cho|
|000001c0| 6f 73 65 20 22 41 64 64 | 20 74 6f 20 4d 65 6e 75 |ose "Add| to Menu|
|000001d0| 22 20 66 72 6f 6d 20 74 | 68 65 20 4d 69 73 63 20 |" from t|he Misc |
|000001e0| 6d 65 6e 75 20 74 6f 20 | 63 6f 6d 70 69 6c 65 20 |menu to |compile |
|000001f0| 69 74 20 7d 0d 7b 20 54 | 68 65 6e 20 6f 70 65 6e |it }.{ T|hen open|
|00000200| 20 61 20 64 61 74 61 20 | 77 69 6e 64 6f 77 20 28 | a data |window (|
|00000210| 69 66 20 6e 6f 6e 65 20 | 69 73 20 6f 70 65 6e 29 |if none |is open)|
|00000220| 2e 20 54 68 65 6e 20 72 | 75 6e 20 74 68 65 20 70 |. Then r|un the p|
|00000230| 72 6f 67 72 61 6d 20 62 | 79 20 63 68 6f 6f 73 69 |rogram b|y choosi|
|00000240| 6e 67 20 7d 0d 7b 20 22 | 48 69 73 74 6f 67 72 61 |ng }.{ "|Histogra|
|00000250| 6d 22 20 66 72 6f 6d 20 | 74 68 65 20 4d 69 73 63 |m" from |the Misc|
|00000260| 20 6d 65 6e 75 2e 20 7d | 0d 0d 70 72 6f 67 72 61 | menu. }|..progra|
|00000270| 6d 20 48 69 73 74 6f 67 | 72 61 6d 3b 0d 0d 63 6f |m Histog|ram;..co|
|00000280| 6e 73 74 20 6d 61 78 4e | 72 49 6e 74 65 72 76 61 |nst maxN|rInterva|
|00000290| 6c 73 20 3d 20 31 30 30 | 30 3b 0d 0d 76 61 72 20 |ls = 100|0;..var |
|000002a0| 77 69 6e 64 6f 77 2c 20 | 63 6f 6c 3a 69 6e 74 65 |window, |col:inte|
|000002b0| 67 65 72 3b 09 20 20 20 | 20 09 7b 20 74 68 65 20 |ger;. | .{ the |
|000002c0| 77 69 6e 64 6f 77 20 61 | 6e 64 20 74 68 65 20 63 |window a|nd the c|
|000002d0| 6f 6c 75 6d 6e 20 77 65 | 20 75 73 65 20 7d 0d 20 |olumn we| use }. |
|000002e0| 20 20 20 69 6e 74 65 72 | 76 61 6c 57 69 64 74 68 | inter|valWidth|
|000002f0| 3a 20 72 65 61 6c 3b 20 | 20 20 20 20 20 7b 20 74 |: real; | { t|
|00000300| 68 65 20 77 69 64 74 68 | 20 6f 66 20 61 6e 20 69 |he width| of an i|
|00000310| 6e 74 65 72 76 61 6c 20 | 7d 0d 20 20 20 20 78 4d |nterval |}. xM|
|00000320| 69 6e 2c 20 78 4d 61 78 | 3a 20 72 65 61 6c 3b 20 |in, xMax|: real; |
|00000330| 20 20 20 20 20 20 20 20 | 7b 20 74 68 65 20 67 72 | |{ the gr|
|00000340| 61 70 68 20 72 61 6e 67 | 65 20 7d 0d 20 20 20 20 |aph rang|e }. |
|00000350| 6f 75 74 70 75 74 54 6f | 3a 20 69 6e 74 65 67 65 |outputTo|: intege|
|00000360| 72 3b 20 20 20 20 20 20 | 20 20 7b 20 31 3a 20 6e |r; | { 1: n|
|00000370| 65 77 20 67 72 61 70 68 | 3b 20 32 3a 20 63 75 72 |ew graph|; 2: cur|
|00000380| 72 65 6e 74 20 67 72 61 | 70 68 3b 20 33 3a 6e 65 |rent gra|ph; 3:ne|
|00000390| 77 20 64 61 74 61 20 77 | 69 6e 64 6f 77 20 7d 0d |w data w|indow }.|
|000003a0| 20 20 20 20 6e 72 49 6e | 74 65 72 76 61 6c 73 3a | nrIn|tervals:|
|000003b0| 20 69 6e 74 65 67 65 72 | 3b 0d 20 20 20 20 76 61 | integer|;. va|
|000003c0| 6c 75 65 73 3a 20 61 72 | 72 61 79 5b 31 2e 2e 6d |lues: ar|ray[1..m|
|000003d0| 61 78 4e 72 49 6e 74 65 | 72 76 61 6c 73 5d 3b 0d |axNrInte|rvals];.|
|000003e0| 20 20 20 20 6d 61 78 56 | 61 6c 75 65 3a 20 72 65 | maxV|alue: re|
|000003f0| 61 6c 3b 20 20 20 20 20 | 20 20 20 20 20 20 7b ca |al; | {.|
|00000400| 6c 61 72 67 65 73 74 20 | 76 61 6c 75 65 20 69 6e |largest |value in|
|00000410| 20 76 61 6c 75 65 73 20 | 7d 0d 0d 70 72 6f 63 65 | values |}..proce|
|00000420| 64 75 72 65 20 69 6e 69 | 74 69 61 6c 69 7a 65 3b |dure ini|tialize;|
|00000430| 0d 20 7b 20 74 68 69 73 | 20 72 6f 75 74 69 6e 65 |. { this| routine|
|00000440| 20 69 73 20 63 61 6c 6c | 65 64 20 6f 6e 63 65 20 | is call|ed once |
|00000450| 77 68 65 6e 20 74 68 65 | 20 70 72 6f 67 72 61 6d |when the| program|
|00000460| 20 69 73 20 61 64 64 65 | 64 20 74 6f 20 7d 0d 20 | is adde|d to }. |
|00000470| 7b 20 70 72 6f 20 46 69 | 74 27 73 20 6d 65 6e 75 |{ pro Fi|t's menu|
|00000480| 73 20 7d 0d 62 65 67 69 | 6e 0d 20 20 77 69 6e 64 |s }.begi|n. wind|
|00000490| 6f 77 20 3a 3d 20 30 3b | 20 20 20 20 20 20 20 20 |ow := 0;| |
|000004a0| 7b 20 64 65 66 61 75 6c | 74 3a 20 75 73 65 20 66 |{ defaul|t: use f|
|000004b0| 72 6f 6e 74 6d 6f 73 74 | 20 64 61 74 61 20 77 69 |rontmost| data wi|
|000004c0| 6e 64 6f 77 20 7d 0d 20 | 20 63 6f 6c 20 3a 3d 20 |ndow }. | col := |
|000004d0| 31 3b 20 20 20 20 20 20 | 20 20 20 20 20 7b 20 20 |1; | { |
|000004e0| 20 20 20 20 20 20 20 20 | 61 6e 64 20 63 6f 6c 75 | |and colu|
|000004f0| 6d 6e 20 31 20 7d 0d 20 | 20 69 6e 74 65 72 76 61 |mn 1 }. | interva|
|00000500| 6c 57 69 64 74 68 20 3a | 3d 20 30 2e 30 31 3b 0d |lWidth :|= 0.01;.|
|00000510| 20 20 78 6d 69 6e 20 3a | 3d 20 2d 31 3b 0d 20 20 | xmin :|= -1;. |
|00000520| 78 6d 61 78 20 3a 3d 20 | 31 3b 0d 20 20 6f 75 74 |xmax := |1;. out|
|00000530| 70 75 74 54 6f 20 3a 3d | 20 31 3b 0d 65 6e 64 3b |putTo :=| 1;.end;|
|00000540| 0d 0d 70 72 6f 63 65 64 | 75 72 65 20 47 65 74 55 |..proced|ure GetU|
|00000550| 73 65 72 43 68 6f 69 63 | 65 3b 0d 20 7b 20 61 73 |serChoic|e;. { as|
|00000560| 6b 20 74 68 65 20 75 73 | 65 72 20 77 68 61 74 20 |k the us|er what |
|00000570| 68 65 2f 73 68 65 20 77 | 61 6e 74 73 20 7d 0d 62 |he/she w|ants }.b|
|00000580| 65 67 69 6e 0d 20 20 49 | 6e 70 75 74 28 27 24 57 |egin. I|nput('$W|
|00000590| 44 61 74 61 20 77 69 6e | 64 6f 77 27 2c 77 69 6e |Data win|dow',win|
|000005a0| 64 6f 77 2c 20 27 24 43 | 43 6f 6c 75 6d 6e 27 2c |dow, '$C|Column',|
|000005b0| 20 63 6f 6c 2c 0d 20 20 | 20 20 20 20 20 20 27 58 | col,. | 'X|
|000005c0| 20 6d 69 6e 27 2c 20 78 | 4d 69 6e 2c 20 27 58 20 | min', x|Min, 'X |
|000005d0| 6d 61 78 27 2c 20 78 4d | 61 78 2c 0d 20 20 20 20 |max', xM|ax,. |
|000005e0| 20 20 20 20 27 49 6e 74 | 65 72 76 61 6c 20 77 69 | 'Int|erval wi|
|000005f0| 64 74 68 27 2c 20 69 6e | 74 65 72 76 61 6c 57 69 |dth', in|tervalWi|
|00000600| 64 74 68 2c 0d 20 20 20 | 20 20 20 20 20 27 24 50 |dth,. | '$P|
|00000610| 6e 65 77 20 67 72 61 70 | 68 3b 63 75 72 72 65 6e |new grap|h;curren|
|00000620| 74 20 67 72 61 70 68 3b | 64 61 74 61 20 77 69 6e |t graph;|data win|
|00000630| 64 6f 77 24 4f 75 70 75 | 74 20 74 6f 27 2c 20 6f |dow$Oupu|t to', o|
|00000640| 75 74 70 75 74 54 6f 29 | 3b 0d 20 20 69 66 20 69 |utputTo)|;. if i|
|00000650| 6e 74 65 72 76 61 6c 57 | 69 64 74 68 20 3c 3d 20 |ntervalW|idth <= |
|00000660| 30 20 74 68 65 6e 0d 20 | 20 20 20 62 65 67 69 6e |0 then. | begin|
|00000670| 0d 20 20 20 20 20 20 41 | 6c 65 72 74 28 27 49 6e |. A|lert('In|
|00000680| 74 65 72 76 61 6c 20 77 | 69 64 74 68 20 6d 75 73 |terval w|idth mus|
|00000690| 74 20 62 65 20 3e 20 30 | 27 29 3b 0d 20 20 20 20 |t be > 0|');. |
|000006a0| 20 20 48 61 6c 74 3b 0d | 20 20 20 20 65 6e 64 3b | Halt;.| end;|
|000006b0| 0d 20 20 69 66 20 78 4d | 69 6e 20 3e 3d 20 78 4d |. if xM|in >= xM|
|000006c0| 61 78 20 74 68 65 6e 0d | 20 20 20 20 62 65 67 69 |ax then.| begi|
|000006d0| 6e 0d 20 20 20 20 20 20 | 41 6c 65 72 74 28 27 58 |n. |Alert('X|
|000006e0| 20 6d 69 6e 20 6d 75 73 | 74 20 62 65 20 73 6d 61 | min mus|t be sma|
|000006f0| 6c 6c 65 72 20 74 68 61 | 6e 20 58 20 6d 61 78 27 |ller tha|n X max'|
|00000700| 29 3b 0d 20 20 20 20 20 | 20 48 61 6c 74 3b 0d 20 |);. | Halt;. |
|00000710| 20 20 20 65 6e 64 3b 0d | 20 20 6e 72 49 6e 74 65 | end;.| nrInte|
|00000720| 72 76 61 6c 73 20 3a 3d | 20 28 78 4d 61 78 2d 78 |rvals :=| (xMax-x|
|00000730| 4d 69 6e 29 2f 69 6e 74 | 65 72 76 61 6c 57 69 64 |Min)/int|ervalWid|
|00000740| 74 68 3b 0d 20 20 69 66 | 20 6e 72 49 6e 74 65 72 |th;. if| nrInter|
|00000750| 76 61 6c 73 20 3e 20 6d | 61 78 4e 72 49 6e 74 65 |vals > m|axNrInte|
|00000760| 72 76 61 6c 73 20 74 68 | 65 6e 0d 20 20 20 20 62 |rvals th|en. b|
|00000770| 65 67 69 6e 0d 20 20 20 | 20 20 20 41 6c 65 72 74 |egin. | Alert|
|00000780| 28 27 49 6e 74 65 72 76 | 61 6c 20 77 69 64 74 68 |('Interv|al width|
|00000790| 20 74 6f 6f 20 73 6d 61 | 6c 6c 20 2d 20 74 6f 6f | too sma|ll - too|
|000007a0| 20 6d 61 6e 79 20 69 6e | 74 65 72 76 61 6c 73 27 | many in|tervals'|
|000007b0| 29 3b 0d 20 20 20 20 20 | 20 48 61 6c 74 3b 0d 20 |);. | Halt;. |
|000007c0| 20 20 20 65 6e 64 3b 0d | 65 6e 64 3b 0d 0d 70 72 | end;.|end;..pr|
|000007d0| 6f 63 65 64 75 72 65 20 | 43 61 6c 63 75 6c 61 74 |ocedure |Calculat|
|000007e0| 65 56 61 6c 75 65 73 3b | 0d 20 7b 20 66 69 6c 6c |eValues;|. { fill|
|000007f0| 73 20 75 70 20 74 68 65 | 20 61 72 72 61 79 20 76 |s up the| array v|
|00000800| 61 6c 75 65 73 5b 5d 20 | 7d 0d 20 76 61 72 20 69 |alues[] |}. var i|
|00000810| 2c 20 69 6e 64 65 78 3b | 0d 62 65 67 69 6e 0d 0d |, index;|.begin..|
|00000820| 20 20 66 6f 72 20 69 20 | 3a 3d 20 31 20 74 6f 20 | for i |:= 1 to |
|00000830| 6e 72 49 6e 74 65 72 76 | 61 6c 73 20 64 6f 20 76 |nrInterv|als do v|
|00000840| 61 6c 75 65 73 5b 69 5d | 20 3a 3d 20 30 3b 0d 20 |alues[i]| := 0;. |
|00000850| 20 66 6f 72 20 69 20 3a | 3d 20 31 20 74 6f 20 6e | for i :|= 1 to n|
|00000860| 72 52 6f 77 73 20 64 6f | 0d 20 20 20 20 69 66 20 |rRows do|. if |
|00000870| 44 61 74 61 4f 4b 28 69 | 2c 20 63 6f 6c 29 20 74 |DataOK(i|, col) t|
|00000880| 68 65 6e 20 20 20 20 20 | 20 20 20 7b 20 69 66 20 |hen | { if |
|00000890| 74 68 65 72 65 20 69 73 | 20 73 6f 6d 65 74 68 69 |there is| somethi|
|000008a0| 6e 67 20 69 6e 20 74 68 | 69 73 20 63 65 6c 6c 20 |ng in th|is cell |
|000008b0| 7d 0d 20 20 20 20 20 20 | 62 65 67 69 6e 0d 20 20 |}. |begin. |
|000008c0| 20 20 20 20 20 20 69 6e | 64 65 78 20 3a 3d 20 31 | in|dex := 1|
|000008d0| 20 2b 20 52 6f 75 6e 64 | 28 28 64 61 74 61 5b 69 | + Round|((data[i|
|000008e0| 2c 63 6f 6c 5d 20 2d 20 | 78 4d 69 6e 29 2f 69 6e |,col] - |xMin)/in|
|000008f0| 74 65 72 76 61 6c 57 69 | 64 74 68 2d 30 2e 34 39 |tervalWi|dth-0.49|
|00000900| 39 39 39 39 39 39 39 29 | 3b 0d 20 20 20 20 20 20 |9999999)|;. |
|00000910| 20 20 69 66 20 28 69 6e | 64 65 78 20 3e 3d 20 31 | if (in|dex >= 1|
|00000920| 29 20 61 6e 64 20 28 69 | 6e 64 65 78 20 3c 3d 20 |) and (i|ndex <= |
|00000930| 6e 72 49 6e 74 65 72 76 | 61 6c 73 29 20 74 68 65 |nrInterv|als) the|
|00000940| 6e 0d 20 20 20 20 20 20 | 20 20 20 20 76 61 6c 75 |n. | valu|
|00000950| 65 73 5b 69 6e 64 65 78 | 5d 20 3a 3d 20 76 61 6c |es[index|] := val|
|00000960| 75 65 73 5b 69 6e 64 65 | 78 5d 2b 31 3b 0d 20 20 |ues[inde|x]+1;. |
|00000970| 20 20 20 20 65 6e 64 3b | 0d 20 20 6d 61 78 56 61 | end;|. maxVa|
|00000980| 6c 75 65 20 3a 3d 20 30 | 3b 0d 20 20 66 6f 72 20 |lue := 0|;. for |
|00000990| 69 20 3a 3d 20 31 20 74 | 6f 20 6e 72 49 6e 74 65 |i := 1 t|o nrInte|
|000009a0| 72 76 61 6c 73 20 64 6f | 0d 20 20 20 69 66 20 76 |rvals do|. if v|
|000009b0| 61 6c 75 65 73 5b 69 5d | 20 3e 20 6d 61 78 56 61 |alues[i]| > maxVa|
|000009c0| 6c 75 65 20 74 68 65 6e | 20 6d 61 78 56 61 6c 75 |lue then| maxValu|
|000009d0| 65 20 3a 3d 20 76 61 6c | 75 65 73 5b 69 5d 3b 0d |e := val|ues[i];.|
|000009e0| 65 6e 64 3b 0d 0d 70 72 | 6f 63 65 64 75 72 65 20 |end;..pr|ocedure |
|000009f0| 4f 75 74 70 75 74 3b 0d | 20 7b 20 63 72 65 61 74 |Output;.| { creat|
|00000a00| 65 73 2f 64 72 61 77 73 | 20 74 68 65 20 67 72 61 |es/draws| the gra|
|00000a10| 70 68 20 7d 0d 20 76 61 | 72 20 69 2c 20 79 3b 0d |ph }. va|r i, y;.|
|00000a20| 62 65 67 69 6e 0d 20 20 | 69 66 20 6f 75 74 70 75 |begin. |if outpu|
|00000a30| 74 54 6f 20 3d 20 33 20 | 74 68 65 6e 20 20 20 20 |tTo = 3 |then |
|00000a40| 20 20 20 20 20 20 7b 20 | 69 66 20 6f 75 74 70 75 | { |if outpu|
|00000a50| 74 20 74 6f 20 64 61 74 | 61 20 77 69 6e 64 6f 77 |t to dat|a window|
|00000a60| 20 7d 0d 20 20 62 65 67 | 69 6e 0d 20 20 20 20 4e | }. beg|in. N|
|00000a70| 65 77 57 69 6e 64 6f 77 | 28 64 61 74 61 54 79 70 |ewWindow|(dataTyp|
|00000a80| 65 29 3b 0d 20 20 20 20 | 53 65 74 44 61 74 61 53 |e);. |SetDataS|
|00000a90| 69 7a 65 28 6e 72 49 6e | 74 65 72 76 61 6c 73 2c |ize(nrIn|tervals,|
|00000aa0| 31 30 29 3b 0d 20 20 20 | 20 53 65 74 43 6f 6c 75 |10);. | SetColu|
|00000ab0| 6d 6e 4e 61 6d 65 28 31 | 2c 20 27 69 6e 74 65 72 |mnName(1|, 'inter|
|00000ac0| 76 61 6c 20 63 65 6e 74 | 65 72 27 29 3b 0d 20 20 |val cent|er');. |
|00000ad0| 20 20 53 65 74 43 6f 6c | 75 6d 6e 4e 61 6d 65 28 | SetCol|umnName(|
|00000ae0| 32 2c 20 27 63 6f 75 6e | 74 73 27 29 3b 0d 20 20 |2, 'coun|ts');. |
|00000af0| 20 20 66 6f 72 20 69 20 | 3a 3d 20 31 20 74 6f 20 | for i |:= 1 to |
|00000b00| 6e 72 49 6e 74 65 72 76 | 61 6c 73 20 64 6f 0d 20 |nrInterv|als do. |
|00000b10| 20 20 20 62 65 67 69 6e | 0d 20 20 20 20 20 20 64 | begin|. d|
|00000b20| 61 74 61 5b 69 2c 31 5d | 20 3a 3d 20 78 4d 69 6e |ata[i,1]| := xMin|
|00000b30| 20 2b 20 28 69 2d 30 2e | 35 29 2a 69 6e 74 65 72 | + (i-0.|5)*inter|
|00000b40| 76 61 6c 57 69 64 74 68 | 3b 0d 20 20 20 20 20 20 |valWidth|;. |
|00000b50| 64 61 74 61 5b 69 2c 32 | 5d 20 3a 3d 20 76 61 6c |data[i,2|] := val|
|00000b60| 75 65 73 5b 69 5d 3b 0d | 20 20 20 20 65 6e 64 3b |ues[i];.| end;|
|00000b70| 0d 20 20 20 20 45 78 69 | 74 3b 0d 20 20 65 6e 64 |. Exi|t;. end|
|00000b80| 3b 0d 20 20 69 66 20 6f | 75 74 70 75 74 54 6f 20 |;. if o|utputTo |
|00000b90| 3d 20 31 20 74 68 65 6e | 20 20 20 20 20 20 20 20 |= 1 then| |
|00000ba0| 20 20 7b 20 69 66 20 6f | 75 74 70 75 74 20 74 6f | { if o|utput to|
|00000bb0| 20 6e 65 77 20 67 72 61 | 70 68 20 7d 0d 20 20 62 | new gra|ph }. b|
|00000bc0| 65 67 69 6e 0d 20 20 20 | 20 53 65 74 4c 69 6e 65 |egin. | SetLine|
|00000bd0| 53 74 79 6c 65 28 31 2c | 31 29 3b 20 20 20 20 20 |Style(1,|1); |
|00000be0| 20 20 20 20 20 7b 20 73 | 65 74 20 73 74 61 6e 64 | { s|et stand|
|00000bf0| 61 72 64 20 6c 69 6e 65 | 20 73 74 79 6c 65 2c 20 |ard line| style, |
|00000c00| 69 6e 20 63 61 73 65 20 | 69 74 20 77 61 73 20 63 |in case |it was c|
|00000c10| 68 61 6e 67 65 64 20 7d | 0d 20 20 20 20 53 65 74 |hanged }|. Set|
|00000c20| 4c 69 6e 65 43 6f 6c 6f | 72 28 30 2c 30 2c 30 29 |LineColo|r(0,0,0)|
|00000c30| 3b 09 7b 62 6c 61 63 6b | 7d 0d 20 20 20 20 53 65 |;.{black|}. Se|
|00000c40| 74 46 69 6c 6c 43 6f 6c | 6f 72 28 36 35 35 33 35 |tFillCol|or(65535|
|00000c50| 2c 30 2c 30 29 3b 20 7b | 70 75 72 65 20 72 65 64 |,0,0); {|pure red|
|00000c60| 7d 0d 20 20 20 20 53 65 | 74 43 75 72 76 65 46 69 |}. Se|tCurveFi|
|00000c70| 6c 6c 28 78 41 78 69 73 | 2c 31 29 3b 0d 20 20 20 |ll(xAxis|,1);. |
|00000c80| 20 43 72 65 61 74 65 4e | 65 77 47 72 61 70 68 28 | CreateN|ewGraph(|
|00000c90| 78 4d 69 6e 2c 78 4d 61 | 78 2c 30 2c 6d 61 78 56 |xMin,xMa|x,0,maxV|
|00000ca0| 61 6c 75 65 2b 31 2c 30 | 2c 30 29 3b 0d 20 20 20 |alue+1,0|,0);. |
|00000cb0| 20 53 65 74 47 72 61 70 | 68 41 74 74 72 69 62 75 | SetGrap|hAttribu|
|00000cc0| 74 65 73 28 70 6c 6f 74 | 42 65 68 69 6e 64 41 78 |tes(plot|BehindAx|
|00000cd0| 65 73 2b 67 72 69 64 49 | 6e 46 72 6f 6e 74 29 3b |es+gridI|nFront);|
|00000ce0| 0d 09 09 65 6e 64 3b 0d | 0d 20 20 4f 70 65 6e 43 |...end;.|. OpenC|
|00000cf0| 75 72 76 65 28 27 48 69 | 73 74 6f 67 72 61 6d 27 |urve('Hi|stogram'|
|00000d00| 29 3b 0d 20 20 4d 6f 76 | 65 54 6f 28 78 4d 69 6e |);. Mov|eTo(xMin|
|00000d10| 2c 30 29 3b 0d 20 20 66 | 6f 72 20 69 20 3a 3d 20 |,0);. f|or i := |
|00000d20| 31 20 74 6f 20 6e 72 49 | 6e 74 65 72 76 61 6c 73 |1 to nrI|ntervals|
|00000d30| 20 64 6f 0d 20 20 62 65 | 67 69 6e 0d 20 20 20 20 | do. be|gin. |
|00000d40| 79 20 3a 3d 20 76 61 6c | 75 65 73 5b 69 5d 3b 0d |y := val|ues[i];.|
|00000d50| 20 20 20 20 4c 69 6e 65 | 28 30 2c 20 79 29 3b 0d | Line|(0, y);.|
|00000d60| 20 20 20 20 4c 69 6e 65 | 28 69 6e 74 65 72 76 61 | Line|(interva|
|00000d70| 6c 57 69 64 74 68 2c 20 | 30 29 3b 0d 20 20 20 20 |lWidth, |0);. |
|00000d80| 4c 69 6e 65 28 30 2c 20 | 2d 79 29 3b 0d 20 20 65 |Line(0, |-y);. e|
|00000d90| 6e 64 3b 0d 20 20 43 6c | 6f 73 65 43 75 72 76 65 |nd;. Cl|oseCurve|
|00000da0| 3b 0d 20 20 69 66 20 6f | 75 74 70 75 74 54 6f 20 |;. if o|utputTo |
|00000db0| 3d 20 31 20 74 68 65 6e | 09 7b 72 65 73 65 74 20 |= 1 then|.{reset |
|00000dc0| 73 6f 6d 65 20 76 61 6c | 75 65 73 20 7d 0d 20 20 |some val|ues }. |
|00000dd0| 62 65 67 69 6e 0d 20 20 | 20 20 53 65 74 43 75 72 |begin. | SetCur|
|00000de0| 76 65 46 69 6c 6c 28 78 | 41 78 69 73 2c 30 29 3b |veFill(x|Axis,0);|
|00000df0| 7b 72 65 73 65 74 20 74 | 6f 20 6e 6f 20 66 69 6c |{reset t|o no fil|
|00000e00| 6c 69 6e 67 7d 0d 20 20 | 20 20 53 65 74 46 69 6c |ling}. | SetFil|
|00000e10| 6c 43 6f 6c 6f 72 28 30 | 2c 30 2c 30 29 3b 20 7b |lColor(0|,0,0); {|
|00000e20| 62 6c 61 63 6b 7d 0d 09 | 09 09 09 53 65 74 46 69 |black}..|...SetFi|
|00000e30| 6c 6c 50 61 74 74 65 72 | 6e 28 30 29 3b 0d 20 20 |llPatter|n(0);. |
|00000e40| 65 6e 64 3b 0d 20 20 77 | 72 69 74 65 6c 6e 28 6e |end;. w|riteln(n|
|00000e50| 72 49 6e 74 65 72 76 61 | 6c 73 29 3b 0d 65 6e 64 |rInterva|ls);.end|
|00000e60| 3b 0d 0d 62 65 67 69 6e | 0d 20 20 47 65 74 55 73 |;..begin|. GetUs|
|00000e70| 65 72 43 68 6f 69 63 65 | 3b 0d 20 20 53 65 74 43 |erChoice|;. SetC|
|00000e80| 75 72 72 65 6e 74 57 69 | 6e 64 6f 77 28 77 69 6e |urrentWi|ndow(win|
|00000e90| 64 6f 77 29 3b 0d 20 20 | 43 61 6c 63 75 6c 61 74 |dow);. |Calculat|
|00000ea0| 65 56 61 6c 75 65 73 3b | 0d 20 20 4f 75 74 70 75 |eValues;|. Outpu|
|00000eb0| 74 3b 0d 65 6e 64 3b 0d | 00 00 00 00 00 00 00 00 |t;.end;.|........|
|00000ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f00| 00 00 01 00 00 00 02 3d | 00 00 01 3d 00 00 00 6a |.......=|...=...j|
|00000f10| 28 6e 72 49 6e 74 65 72 | 76 61 6c 73 2c 31 30 29 |(nrInter|vals,10)|
|00000f20| 3b 0d 20 20 20 20 53 65 | 74 43 6f 6c 75 6d 6e 4e |;. Se|tColumnN|
|00000f30| 09 48 69 73 74 6f 67 72 | 61 6d 02 00 00 00 66 74 |.Histogr|am....ft|
|00000f40| 46 43 4e 4c 66 74 01 00 | ff ff ff ff 00 00 00 00 |FCNLft..|........|
|00000f50| 00 00 66 74 46 43 4e 4c | 66 74 01 00 ff ff ff ff |..ftFCNL|ft......|
|00000f60| 00 00 00 00 00 00 00 00 | 00 00 80 00 00 00 00 00 |........|........|
|00000f70| 00 00 ac ae 7a 69 00 00 | 0e 38 00 00 02 a7 72 49 |....zi..|.8....rI|
|00000f80| 6e 74 65 72 76 61 6c 73 | 20 64 6f 0d 20 20 20 20 |ntervals| do. |
|00000f90| 62 65 67 69 6e 0d 20 20 | 20 20 20 20 64 61 74 61 |begin. | data|
|00000fa0| 5b 69 2c 31 5d 20 3a 3d | 20 78 4d 69 6e 20 2b 20 |[i,1] :=| xMin + |
|00000fb0| 28 69 2d 30 2e 35 29 2a | 69 6e 74 65 72 76 61 6c |(i-0.5)*|interval|
|00000fc0| 57 69 64 74 68 3b 0d 20 | 20 20 20 20 20 64 61 74 |Width;. | dat|
|00000fd0| 61 5b 69 2c 32 5d 20 3a | 3d 20 76 61 6c 75 65 73 |a[i,2] :|= values|
|00000fe0| 5b 69 5d 3b 0d 20 20 20 | 20 65 6e 64 3b 0d 20 20 |[i];. | end;. |
|00000ff0| 20 20 45 78 69 74 3b 0d | 20 20 65 6e 64 3b 0d 20 | Exit;.| end;. |
|00001000| 00 00 00 08 00 2a 00 2c | 03 0d 02 51 00 00 01 06 |.....*.,|...Q....|
|00001010| 00 04 00 09 00 00 06 4d | 6f 6e 61 63 6f 10 01 17 |.......M|onaco...|
|00001020| 53 60 00 00 2d a0 01 3c | 46 f0 22 00 02 44 40 a1 |S`..-..<|F."..D@.|
|00001030| 27 a0 00 5c 5c 9c 00 81 | 00 00 00 01 d9 94 00 0b |'..\\...|........|
|00001040| 00 06 00 0b 00 06 00 00 | 00 81 01 16 c4 d0 00 00 |........|........|
|00001050| 00 00 01 16 ba 94 00 00 | 00 81 01 16 c4 d0 00 00 |........|........|
|00001060| 00 00 ff ff ff ff 01 3c | 48 40 01 16 ae cc 01 02 |.......<|H@......|
|00001070| 9f b8 01 16 b5 2e 01 16 | b4 78 01 16 5d 10 01 3c |........|.x..]..<|
|00001080| 47 28 00 00 00 00 01 3c | 48 28 00 00 63 c0 00 00 |G(.....<|H(..c...|
|00001090| 02 29 00 00 01 c3 00 00 | 00 00 00 00 01 b3 00 00 |.)......|........|
|000010a0| 02 19 00 00 00 00 01 3c | 47 a0 24 08 02 82 00 11 |.......<|G.$.....|
|000010b0| c0 d4 00 0b e3 f0 01 3c | 47 a0 00 15 88 9c 00 11 |.......<|G.......|
|000010c0| b8 a4 00 00 63 c0 01 3c | 47 a0 00 15 88 9c 02 80 |....c..<|G.......|
|000010d0| 00 00 00 00 00 00 00 00 | 00 50 00 15 88 9c 02 1a |........|.P......|
|000010e0| 01 b4 02 1a 01 b4 01 3c | 47 b0 00 00 00 00 00 9c |.......<|G.......|
|000010f0| 00 00 00 09 97 f0 00 00 | 90 90 00 01 2f a4 00 00 |........|..../...|
|00001100| 00 00 00 09 98 20 01 16 | d8 32 00 0a 12 a0 07 80 |..... ..|.2......|
|00001110| 03 80 00 00 00 00 00 00 | 00 10 00 00 00 00 00 00 |........|........|
|00001120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 04 00 00 |........|........|
|00001130| 00 01 00 00 00 07 06 70 | 72 6f 46 69 74 00 00 01 |.......p|roFit...|
|00001140| 00 00 00 02 3d 00 00 01 | 3d 00 00 00 6a 01 16 eb |....=...|=...j...|
|00001150| 8c 1c a6 00 00 00 1c 00 | 6a 00 01 66 49 4e 46 00 |........|j..fINF.|
|00001160| 03 00 12 53 54 52 20 00 | 00 00 42 00 81 ff ff 00 |...STR .|..B.....|
|00001170| 00 00 00 01 16 e2 a0 00 | 82 ff ff 00 00 00 0c 01 |........|........|
|00001180| 00 89 c4 00 83 ff ff 00 | 00 01 16 01 00 89 bc 00 |........|........|
|00001190| 85 ff ff 00 00 01 2a 01 | 16 e0 f0 bf f4 ff ff 00 |......*.|........|
|000011a0| 00 01 32 01 16 e1 3c 00 | 00 00 00 00 00 00 00 00 |..2...<.|........|
|000011b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+